package cn.wolfcode.domain;

import cn.wolfcode.resultpage.Json;
import com.alibaba.fastjson.JSON;
import lombok.*;

import java.util.HashMap;

@Getter
@Setter
@ToString
public class Department {
    private Long id;
    private String name;
    private String sn;

    //把部门转成json字符串
    public String getJson(){
        HashMap map = new HashMap();
        map.put("id",id);
        map.put("name",name);
        map.put("sn",sn);

        // 不能直接传this进去,会出现死循环
        return JSON.toJSONString(map);
    }
}
